-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature(checkbox): Add ripple effect to checkbox #1611
Conversation
fixture.detectChanges(); | ||
|
||
expect(checkboxNativeElement.querySelectorAll('[md-ripple]').length).toBe(0, | ||
'Expect no [md-ripple] in checkbox'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, prefer to break at the higher syntactic level, e.g.:
expect(checkboxNativeElement.querySelectorAll('[md-ripple]').length)
.toBe(0, 'Expect no [md-ripple] in checkbox');
|
||
isRippleEnabled() { | ||
return !this.disableRipple; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not bind to the disableRipple
directly?
@@ -88,6 +89,9 @@ export class MdCheckbox implements ControlValueAccessor { | |||
/** A unique id for the checkbox. If one is not supplied, it is auto-generated. */ | |||
@Input() id: string = `md-checkbox-${++nextId}`; | |||
|
|||
/** Whether the ripple effect on click should be disabled. */ | |||
@Input() @BooleanFieldValue() disableRipple: boolean = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just removed @BooleanFieldValue
in another PR- custom decorators like this caused tree-shaking not to work. The replacement is a function called coerceBooleanProperty
01a8190
to
d490bc2
Compare
d490bc2
to
2ef7562
Compare
Comments addressed. Please take another look. Thanks! |
LGTM |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
R: @jelbourn